<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2022-05-25
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<input type="button" value="新增" id="To"> <br>
<hr>
<table border="1" cellpadding="0" width="800">
    <tr>
        <th>序号</th>
        <th>品牌名称</th>
        <th>企业名称</th>
        <th>排序</th>
        <th>品牌介绍</th>
        <th>状态</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${brands}" var="brand" varStatus="status">
        <tr align="center">
            <td>${brand.getId()}</td>
            <td>${brand.getBrandName()}</td>
            <td>${brand.getCompanyName()}</td>
            <td>${brand.getOrdered()}</td>
            <td>${brand.getDescript()}</td>
            <c:if test="${brand.status ==1}">
                <td>启用</td>
            </c:if>
            <c:if test="${brand.status !=1}">
                <td>禁用</td>
            </c:if>
            <td><a href="/brand-demo/slectId?id=${brand.getId()}">修改</a><a href="#">删除</a></td>
        </tr>
    </c:forEach>
</table>

</body>
<script>
    document.getElementById("To").addEventListener("click", () => {
        location.href = "/brand-demo/addBrand.jsp";
    })
</script>
</html>
